home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 2 / BBS in a box - Trilogy II.iso / Files / Hyper / A-An / Animation Help v.1.03 / Animation Help v.1.03 / card_19750.txt < prev    next >
Encoding:
Text File  |  1990-07-07  |  1.8 KB  |  89 lines

  1. -- card: 19750 from stack: in.03
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 7844
  5. -- name: 
  6.  
  7.  
  8. -- part 1 (button)
  9. -- low flags: 00
  10. -- high flags: 0000
  11. -- rect: left=280 top=213 right=247 bottom=323
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 22332 / 22332
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Ball
  20. ----- HyperTalk script -----
  21. on mouseEnter
  22.   repeat
  23.     set cursor to 22
  24.     show me at the mouseloc
  25.     if the mouse is down
  26.     then
  27.     set cursor to none
  28.     dropBall
  29.     exit repeat
  30.   end if
  31. end repeat
  32. end mouseEnter
  33.  
  34. on dropBall
  35.   global s, floor
  36.   put 230 into floor
  37.   put 1.2 into gravity
  38.   put 1.3 into bounce
  39.   put 4 into s
  40.   put item 1 of loc of me into h
  41.   put item 2 of loc of me into v
  42.   repeat
  43.     repeat
  44.       show me at h,v
  45.       put s^(gravity) into s
  46.       put round(v + s) into v
  47.       if v > floor then
  48.         put floor into v
  49.         exit repeat
  50.       end if
  51.     end repeat
  52.     show me at h,v
  53.  
  54.     repeat with k = 1 to 3
  55.       set icon of me to "ball" && k
  56.     end repeat
  57.     play "bounce"
  58.     repeat with k = 2 down to 1
  59.       set icon of me to "ball" && k
  60.     end repeat
  61.  
  62.     put s/bounce into s
  63.     repeat
  64.       put v into temp
  65.       put s^(1/gravity) into s
  66.       put round(v - s) into v
  67.       show me at h,v
  68.  
  69.       if abs(v - floor) < 10 then
  70.         set icon of me to "ball 1"
  71.         put floor into v
  72.         show me at h,v
  73.         exit dropBall
  74.       end if
  75.       if temp - v < 10 then
  76.         exit repeat
  77.       end if
  78.     end repeat
  79.   end repeat
  80. end dropBall
  81.  
  82.  
  83. -- part contents for background part 11
  84. ----- text -----
  85. Bouncing Ball
  86.  
  87. -- part contents for background part 12
  88. ----- text -----
  89. Put the cursor on the ball, drag it up, and then click to let go of it.